package com.itany.corejava.day07;

public class Point {

    private double x;
    private double y;

    public Point(double x, double y) {
        this.x = x;
        this.y = y;
    }

    public Point() {
        this(0,0);
    }

    public double distance(Point other){
        return distance(other.x,other.y);
    }

    public double distance(double x,double y){
        return Math.sqrt(Math.pow((this.x-x),2)+Math.pow(this.y-y,2));
    }

    public double distance(){
        return distance(new Point());
    }















    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }
}
